package cn.javass.xgen.genconf.vo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * x-gen核心框架配置对应的数据model
 */
public class GenConfModel {

    /**
     * 注册的多个用户需要生成的模块的model
     */
    private List<NeedGenModel> needGen = new ArrayList<NeedGenModel>();

    /**
     * 注册的外部主题的model
     */
    private List<ThemeModel> themes = new ArrayList<ThemeModel>();

    /**
     * 通用的常量定义
     */
    private Map<String,String> mapConstants = new HashMap<String, String>();

    public List<NeedGenModel> getNeedGen() {
        return needGen;
    }

    public void setNeedGen(List<NeedGenModel> needGen) {
        this.needGen = needGen;
    }

    public List<ThemeModel> getThemes() {
        return themes;
    }

    public void setThemes(List<ThemeModel> themes) {
        this.themes = themes;
    }

    public Map<String, String> getMapConstants() {
        return mapConstants;
    }

    public void setMapConstants(Map<String, String> mapConstants) {
        this.mapConstants = mapConstants;
    }

    public ThemeModel getThemeById(String themeId){
        for (ThemeModel tm: this.themes) {
            if(tm.getId().equals(themeId)){
                return tm;
            }
        }
        return new ThemeModel();
    }
}
